home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / include / RCS / input.h,v < prev    next >
Encoding:
Text File  |  1990-02-15  |  4.0 KB  |  157 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     90.02.14.16.17.20;  author tve;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @Original X11R4 distribution
  17. @
  18.  
  19.  
  20.  
  21. 1.1
  22. log
  23. @Initial revision
  24. @
  25. text
  26. @/************************************************************
  27. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  28. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  29.  
  30.                         All Rights Reserved
  31.  
  32. Permission to use, copy, modify, and distribute this software and its 
  33. documentation for any purpose and without fee is hereby granted, 
  34. provided that the above copyright notice appear in all copies and that
  35. both that copyright notice and this permission notice appear in 
  36. supporting documentation, and that the names of Digital or MIT not be
  37. used in advertising or publicity pertaining to distribution of the
  38. software without specific, written prior permission.  
  39.  
  40. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  41. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  42. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  43. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  44. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  45. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  46. SOFTWARE.
  47.  
  48. ********************************************************/
  49. #ifndef INPUT_H
  50. #define INPUT_H
  51.  
  52. #include "misc.h"
  53.  
  54. #define DEVICE_INIT    0
  55. #define DEVICE_ON    1
  56. #define DEVICE_OFF    2
  57. #define DEVICE_CLOSE    3
  58.  
  59. #define MAP_LENGTH    256
  60. #define DOWN_LENGTH    32    /* 256/8 => number of bytes to hold 256 bits */
  61. #define NullGrab ((GrabPtr)NULL)
  62. #define PointerRootWin ((WindowPtr)PointerRoot)
  63. #define NoneWin ((WindowPtr)None)
  64. #define NullDevice ((DevicePtr)NULL)
  65.  
  66. #ifndef FollowKeyboard
  67. #define FollowKeyboard         3
  68. #endif
  69. #ifndef FollowKeyboardWin
  70. #define FollowKeyboardWin  ((WindowPtr) FollowKeyboard)
  71. #endif
  72. #ifndef RevertToFollowKeyboard
  73. #define RevertToFollowKeyboard    3
  74. #endif
  75.  
  76. typedef unsigned long Leds;
  77. typedef struct _OtherClients *OtherClientsPtr;
  78. typedef struct _InputClients *InputClientsPtr;
  79. typedef struct _GrabRec *GrabPtr;
  80.  
  81. typedef int (*DeviceProc)();
  82. typedef void (*ProcessInputProc)();
  83.  
  84. typedef struct _DeviceRec {
  85.     pointer    devicePrivate;
  86.     ProcessInputProc processInputProc;
  87.     ProcessInputProc realInputProc;
  88.     Bool    on;            /* used by DDX to keep state */
  89. } DeviceRec, *DevicePtr;
  90.  
  91. typedef struct {
  92.     int            click, bell, bell_pitch, bell_duration;
  93.     Bool        autoRepeat;
  94.     unsigned char    autoRepeats[32];
  95.     Leds        leds;
  96. } KeybdCtrl;
  97.  
  98. typedef struct {
  99.     KeySym  *map;
  100.     KeyCode minKeyCode,
  101.         maxKeyCode;
  102.     int     mapWidth;
  103. } KeySymsRec, *KeySymsPtr;
  104.  
  105. typedef struct {
  106.     int        num, den, threshold;
  107. } PtrCtrl;
  108.  
  109. typedef struct {
  110.     int         resolution, min_value, max_value;
  111.     int         integer_displayed;
  112. } IntegerCtrl;
  113.  
  114. typedef struct {
  115.     int         max_symbols, num_symbols_supported;
  116.     int         num_symbols_displayed;
  117.     KeySym      *symbols;
  118. } StringCtrl;
  119.  
  120. typedef struct {
  121.     int         percent, pitch, duration;
  122. } BellCtrl;
  123.  
  124. typedef struct {
  125.     Leds        led_values;
  126. } LedCtrl;
  127.  
  128. extern KeybdCtrl    defaultKeyboardControl;
  129. extern PtrCtrl        defaultPointerControl;
  130.  
  131. extern DevicePtr AddInputDevice();
  132. extern Bool EnableDevice();
  133. extern Bool DisableDevice();
  134. extern void RegisterPointerDevice();
  135. extern void RegisterKeyboardDevice();
  136. extern DevicePtr LookupKeyboardDevice();
  137. extern DevicePtr LookupPointerDevice();
  138.  
  139. extern void ProcessPointerEvent();
  140. extern void ProcessKeyboardEvent();
  141.  
  142. extern Bool InitKeyClassDeviceStruct();
  143. extern Bool InitButtonClassDeviceStruct();
  144. extern Bool InitFocusClassDeviceStruct();
  145. extern Bool InitKbdFeedbackClassDeviceStruct();
  146. extern Bool InitPtrFeedbackClassDeviceStruct();
  147. extern Bool InitValuatorClassDeviceStruct();
  148. extern Bool InitPointerDeviceStruct();
  149. extern Bool InitKeyboardDeviceStruct();
  150.  
  151. extern void CloseDownDevices();
  152.  
  153. extern void WriteEventsToClient();
  154.  
  155. #endif /* INPUT_H */
  156. @
  157.